%% Author: RD
%% Created: 2006-12-29
%% Description: TODO: Add desciption to test_aleph_server
-module(test_aleph_server).
-import(aleph_process_labeler,[label_process/1,label_application/1,unlabel_application/0]).
%%
%% Include files
%%
-define(TEST_SERVICES,[{test_aleph_process_labeler,[]},
                       {aleph_dht_rpc,[9876,test_aleph_dht_rpc]},
                       {aleph_config,[]},
                       {aleph_dht_table,[dht_node:create(1,2009,9009,1,0,100)]}]).
%%
%% Exported Functions
%%
-export([set_up/0,tear_down/0]).

%%
%% API Functions
%%

%%%%%%%%%%test functions
set_up()->      
    Object=aleph_server:start_link(test_app),
    label_application(test_app), 
    lists:foreach(fun({SRV,ARGS})-> 
        io:format("starting service ~p:~p...  ~p~n",
                  [SRV,ARGS,aleph_server:start_service(SRV,ARGS)])
        end,?TEST_SERVICES),
    Object.
    
tear_down()->
    aleph_server:shutdown(),
    lists:foreach(fun({SRV,_})-> aleph_server:remove_service(SRV) end,?TEST_SERVICES),
    unlabel_application().

%%
%% Local Functions
%%

